//
//  MANavViewController.m
//  MateAdv
//
//  Created by 茶 on 2023/9/8.
//

#import "MANavViewController.h"

@interface MANavViewController ()

@end

@implementation MANavViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
    UIImage *backImg = [UIImage imageWithColor:UIColor.clearColor size:CGSizeMake(1, 1)];
    [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backImg forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    
    [[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName : MAFontScaleSemibold(18),
                                                           NSForegroundColorAttributeName : UIColor.whiteColor}];
    [[UINavigationBar appearance] setBackIndicatorImage:backImg];
    [[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:backImg];
//    [[UINavigationBar appearance] setTranslucent:NO];
//    [[UINavigationBar appearance] setBackgroundColor:UIColor.clearColor];
//    [[UINavigationBar appearance] setBarTintColor:UIColorClear];
    
    self.navigationBar.qmui_effectForegroundColor = UIColor.clearColor;
    
    if (@available(iOS 13.0, *)) {
        UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
        [appearance configureWithDefaultBackground];
        [appearance setBackIndicatorImage:backImg transitionMaskImage:backImg];
        [appearance setBackgroundColor:UIColor.clearColor];
        [UINavigationBar appearance].standardAppearance = appearance;
        [UINavigationBar appearance].compactAppearance = appearance;
//        [UINavigationBar appearance].scrollEdgeAppearance = appearance;
    }
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
